{layout name="passport:main" /}
<form id="form" action="{url('manage/index/password')}">
    <table class="formtable">
    <tr>
        <th>用户名:</th>
        <td>{$user.username}</td>
    </tr>
    {if $user.safe_password}
    <tr>
        <th>安全密码:</th>
        <td>
            <input datatype="*" placeholder="请验证安全密码" datatype="s6-18" class="input" type="password" name="safe_password" />
        </td>
    </tr>
    {else}
    <tr>
        <th>登录密码:</th>
        <td>
            <input datatype="*" placeholder="请验证现登录密码" datatype="s6-18" class="input" type="password" name="login_password" />
        </td>
    </tr>
    {/if}
    <tr>
        <th>新的密码:</th>
        <td><input placeholder="请输入新密码" nullmsg="请设置密码" datatype="s6-18" class="input" type="password" name="password" /></td>
    </tr>
    <tr>
        <th>验证密码:</th>
        <td><input placeholder="请输入验证密码" errormsg="验证密码不一致" datatype="*" class="input" type="password" name="repassword" /></td>
    </tr>
    <tr>
        <th></th>
        <td>
            <input type="submit" value="确 定" class="button submit button-blue" />
            <input type="reset" value="重 置" class="button button-blank"/>
        </td>
    </tr>
    </table>
</div>
<script type="text/javascript">
Do('base','layer','form',function(){
    $("#form").Validform({
        btnSubmit:".btn",ajaxPost:true,tiptype:4,postonce:true,
        callback:function(data){
            if(data.code == 1){
                parent.layer.alert(data['msg'],{icon:5})
            }else{
                parent.layer.alert(data.msg,{icon:1},function(index){
                    window.parent.location.replace(data.url);
                    parent.layer.close(index);
                });
            }
        }
    });
})
</script>